<template>
  <div>
      <h1>课程详情页面</h1>
      <table border="1">
          <tr>
              <td>课程名称</td>
              <td>课程价格</td>
              <td>课程视频</td>
          </tr>
          <tr>
              <td>{{courseinfo.title}}</td>
              <td>{{courseinfo.price}}</td>
              <td><video width="200" height="120" :src="src+courseinfo.video" controls="controals" autoplay="autoplay"></video></td>
          </tr>
      </table>
  </div>
</template>

<script>
export default {
    data(){
        return{
            cid:this.$route.query.cid,
            courseinfo:{},
            src:'http://127.0.0.1:8000/static/upload/'
        }
    },
    mounted:function(){
        this.getcourseinfo()
    },
    methods:{
        getcourseinfo(){
            this.axios.get('http://127.0.0.1:8000/course_info?cid='+this.cid).then(resp=>{
            console.log(resp.data)
            this.courseinfo = resp.data
        }).catch(error=>{
            console.log(error)
        })
        }
    }
}
</script>

<style>

</style>